package A1_2;

public class main {
    public static void main(String[] args){
        /**
         *
         Building 类：表示学院中的一个建筑。
         Course 类：表示在建筑中进行的课程，并且每个课程都必须在某个建筑中。
         College 类：表示学院，它包含多个建筑和课程。由于建筑和课程在这里都是学院的一部分，我们可以将它们作为 College 类的属性，并使用集合（如 List 或 Set）来存储它们。
         */
        Building building1 = new Building("A栋", "A区");
        Building building2 = new Building("B栋", "B区");
        Course course1 = new Course("Course1", building1);
        Course course2 = new Course("Course2", building2);
        Course course3 = new Course("Course3", building1);
        College college = new College();
        college.addBuilding(building1);
        college.addBuilding(building2);
        college.addCourse(course1);
        college.addCourse(course2);
        college.addCourse(course3);

        System.out.println("Building和College关系");
        System.out.println(college.getBuildingList());

        System.out.println("Course和College关系");
        System.out.println(college.getCourseList());

        System.out.println("Course和Building关系");
        System.out.println("Course1:"+course1.getBuilding());
        System.out.println("Course2:"+course2.getBuilding());
        System.out.println("Course3:"+course3.getBuilding());
    }
}
